
/* Library includes. */
#include <string.h>

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "FreeRTOSConfig.h"

/* HAL includes */
#include "clock.h"
#include "uart.h"
#include "config.h"
#include "user_interface.h"
#include "timer.h"
#include "led.h"
#include "gpio.h"
#include "adc.h"
#include "wdt.h"
#include "pwm.h"
#include "i2c.h"
#include "filter.h"



int main(void)
{

    clock_init();

    gpio_init();

    led_init();

    /* initialize controller uart */
    uart_init(UART_BAUDRATE);

    /* initialize pwm for motor drivers */
    pwm_init();

    /* initialize adc for battery monitoring */
    adc_init();

    ui_printf("\nCopter bootet...\n");

    /* create user interface task */
    user_interface_init();

    /* initialize i2c */
    i2c2_init();

    /* create filter task */
    filter_init();

    /* Start the scheduler. */
    vTaskStartScheduler();

    /* Will only get here if there was insufficient memory to create the idle
     task. */
    for (;;)
        ;
    return 0;
}

